wayland: Don't translate a NULL region into an empty one
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 7 Nov 2014 16:16:59 +0000 (17:16 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 7 Nov 2014 16:23:54 +0000 (17:23 +0100)
cairo_region_copy(NULL) will effectively return an empty region, as this
function is always meant to return valid memory. This however inverts the
meaning of the NULL region and results in entirely non-clickable windows.

gdk/wayland/gdkwindow-wayland.c

index 96d9dc66d32045afd9493ac177ea77a79d0c4785..b49dda32fef882fcaab44faccb38c45ddee3aa14 100644 (file)
@@ -1437,8 +1437,13 @@ gdk_window_wayland_input_shape_combine_region (GdkWindow            *window,
     return;
 
   g_clear_pointer (&impl->input_region, cairo_region_destroy);
-  impl->input_region = cairo_region_copy (shape_region);
-  cairo_region_translate (impl->input_region, offset_x, offset_y);
+
+  if (shape_region)
+    {
+      impl->input_region = cairo_region_copy (shape_region);
+      cairo_region_translate (impl->input_region, offset_x, offset_y);
+    }
+
   gdk_wayland_window_sync_input_region (window);
 }